import javax.swing.JComponent;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;

public class CheckerBoardComponent extends JComponent
{
   public void paintComponent(Graphics g)
   {
      Graphics2D g2 = (Graphics2D) g;
      // your work here
      g2.setColor(Color.red);
      g2.fillRect(0,0,50,50);
      g2.fillRect(100,0,50,50);
      g2.fillRect(50,50,50,50);
      g2.fillRect(0,100,50,50);
      g2.fillRect(100,100,50,50);
      
   }
}